package TwoClientGameConnection;

/**
 * This is a data class used in the implementation of the
 * the TCGMessage. Stores a key-value set of data that
 * can be retrieved from the message.
 * @author Jace Ferguson
 * @filename parameter.java
 */
public class parameter
{
	String paramName;
	String paramValue;

	/**
	 * A constructor that creates a parameter object
	 * and passes in the key-value set.
	 * @param ParamName	String	The key for the parameter.
	 * @param ParamValue	String	The data value of the parameter.
	 */
	public parameter(String ParamName, String ParamValue)
	{
		this.paramName = ParamName;
		this.paramValue = ParamValue;
	}

	/**
	 * Retrieve the key for the parameter.
	 * @return	String	The key for this specific data value.
	 */
	public String getParamName()
	{
		if(this.paramName != null)
		{
			return this.paramName;
		}
		return "";
	}

	/**
	 * Retrieve the parameter value without the use of the key.
	 * If no parameter value is set, an empty string is returned.
	 * @return	String	Value of the parameter.
	 */
	public String getParamValue()
	{
		if(this.paramValue != null)
		{
			return this.paramValue;
		}
		return "";
	}

	/**
	 * Return the name of the parameter.
	 */
	public String toString()
	{
		return this.paramName;
	}
}
